package com.xiaodu.acer.phoneplay.ui.fragment;

import android.annotation.SuppressLint;

import com.xiaodu.acer.phoneplay.ui.adapter.AppInfoAdapter;
import com.xiaodu.acer.phoneplay.ui.base.BaseAppInfoFragment;


@SuppressLint("ValidFragment")
public class CategoryAppFragment extends BaseAppInfoFragment {

    private int categoryId;
    private int mFlagType;

    public CategoryAppFragment(int categoryId, int flagType) {
        this.categoryId = categoryId;
        this.mFlagType = flagType;
    }


    public static CategoryAppFragment newInstance(int categoryId, int flagType) {
        return new CategoryAppFragment(categoryId, flagType);
    }

    @Override
    protected int type() {
        return 0;
    }

    @Override
    public AppInfoAdapter buildAdapter() {
        return AppInfoAdapter.builder()
                .showPosition(false)
                .showBrief(true)
                .showCategoryName(false)
                .retrofit(mRetrofit)
                .build();
    }

    @Override
    public void init() {
        mPresenter.requestCategoryApps(categoryId, page, mFlagType);
        initRecyclerView();
    }

}
